package cn.com.twoke.application.game.mario.game.component;

import cn.com.twoke.application.game.mario.core.ecs.component.Component;
import cn.com.twoke.application.game.mario.game.config.GameConfig;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 玩家组件
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PlayerComponent implements Component {
    private static final GameConfig config = GameConfig.getInstance();
    
    public String name;
    /**
     * 水平移动速度
     */
    public float moveSpeed = config.getPlayerMoveSpeed();
    /**
     * 是否蹲下
     */
    public boolean isDown = false;
    public boolean isRight = false;
    public boolean isLeft = false;
    public boolean isJump = false;
    private Direction direction = Direction.RIGHT;

    public enum Direction {
        LEFT, RIGHT;
    }

}
